import sys
import random

def f(lt):
    total = sum(lt.values())    
    return  lt.get('red')/total,lt.get('yellow')/total,lt.get('green')/total

a=[{'red':45,'yellow':5,'green':50},
   {'red':15,'yellow':3,'green':10},
   {'red':35,'yellow':4,'green':61},
   {'red':120,'yellow':5,'green':60},
  ]
for i  in range(4):
    fin = open('{}.in'.format(i+1),'w')
    fout = open('{}.out'.format(i+1),'w')
    print(a[i].get('red'),a[i].get('yellow'),a[i].get('green'),sep=' ',file=fin)
    print('{:.2f} {:.2f} {:.2f}'.format(*f(a[i])),file=fout)
    fin.close()
    fout.close()
